<template>
  <section>
    <van-nav-bar title="设置"
                 fixed
                 placeholder
                 safe-area-inset-top/>
  </section>

  <section>
    <van-cell-group  inset>
      <van-cell title="用户名" :value="userName" clickable/>
      <van-cell title="用户隐私协议" value="点击查看" clickable/>
      <van-cell title="QQ" value="1014924263" clickable/>
      <van-cell title="邮箱" value="1014924263@qq.com" clickable/>
    </van-cell-group>
  </section>

  <van-divider/>

  <section>
    <van-cell-group inset>
      <van-cell title="退出登录"
                @click="logout"
                value="GO"
                url=""
                clickable/>

    </van-cell-group>
  </section>

</template>

<script setup>
// import initializeWebsocket from "@/plugins/initialize-websocket";
import {setToken} from "@/util/auth";
import {useRouter} from "vue-router";
let router = useRouter();
let userName = localStorage.getItem("userName")
function logout() {
  setToken(null)
  localStorage.setItem("userName",null)
  router.push({
    path: "/",
  });
}
</script>

<style scoped lang="scss">

</style>
